package com.med.controller;

import com.med.service.ScheduleService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: Internet-based-healthcare
 * @BelongsPackage: com.med.controller
 * @Author: 小龚
 * @CreateTime: 2025-08-25 17:14
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/task")
public class TaskController {

    private final ScheduleService scheduleService;


    @Autowired
    public TaskController(ScheduleService scheduleService) {
        this.scheduleService = scheduleService;
    }


    // 查询排班状态
    @GetMapping("/getScheduleStatus")
    public AjaxResult getScheduleStatus() {
        return AjaxResult.success(scheduleService.getScheduleStatus());
    }

    // 智能排班开关
    @PutMapping("/enableScheduling")
    public AjaxResult enableScheduling() {
        return AjaxResult.success(scheduleService.updateSchedulingStatus());
    }
}
